package com.xmcc.dto;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Setter
@Getter
public class SysUserDto implements Serializable {
    private Integer id;

    @NotBlank(message = "用户名不为空")
    @Length(min = 3,max = 20,message = "用户名长度在3-20之间")
    private String username;

    @NotBlank(message = "电话不为空")
    @Length(min = 11,max = 11,message = "电话长度在11位")
    private String telephone;
    //可以自定义正则表达式
    @NotBlank(message = "邮箱不为空")
    @Length(min = 7,max = 20,message = "邮箱长度在11位")
    private String mail;
    @NotNull
    private Integer deptId;
    @NotNull(message = "状态不为空")
    @Min(value = 0,message = "状态，1：正常，0：冻结状态，2：删除")
    @Max(value=2,message = "状态，1：正常，0：冻结状态，2：删除")
    private Integer status;
    @NotBlank(message = "备注不为空")
    @Length(min = 1,max = 200,message = "备注长度200")
    private String remark;


}
